package dto

import (
    "go-admin/app/hunter/models"
    "go-admin/common/dto"
    common "go-admin/common/models"
)

type HtResumeGetPageReq struct {
    dto.Pagination `search:"-"`
    TalentId       string `form:"talentId"  search:"type:contains;column:talent_id;table:ht_resume" comment:"人才id"`
    HtResumeOrder
}

type HtResumeOrder struct {
    Id        string `form:"idOrder"  search:"type:order;column:id;table:ht_resume"`
    TalentId  string `form:"talentIdOrder"  search:"type:order;column:talent_id;table:ht_resume"`
    FileUri   string `form:"fileUriOrder"  search:"type:order;column:file_uri;table:ht_resume"`
    CreateBy  string `form:"createByOrder"  search:"type:order;column:create_by;table:ht_resume"`
    UpdateBy  string `form:"updateByOrder"  search:"type:order;column:update_by;table:ht_resume"`
    CreatedAt string `form:"createdAtOrder"  search:"type:order;column:created_at;table:ht_resume"`
    UpdatedAt string `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:ht_resume"`
    DeletedAt string `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:ht_resume"`
}

func (m *HtResumeGetPageReq) GetNeedSearch() interface{} {
    return *m
}

type HtResumeInsertReq struct {
    Id       int    `json:"-" comment:"id"` // id
    TalentId int    `json:"talentId" comment:"人才id"`
    FileUri  string `json:"fileUri" comment:"附件路径"`
    common.ControlBy
}

func (s *HtResumeInsertReq) Generate(model *models.HtResume) {
    if s.Id == 0 {
        model.Model = common.Model{Id: s.Id}
    }
    model.TalentId = s.TalentId
    model.FileUri = s.FileUri
    model.CreateBy = s.CreateBy // 添加这而，需要记录是被谁创建的
}

func (s *HtResumeInsertReq) GetId() interface{} {
    return s.Id
}

type HtResumeUpdateReq struct {
    Id       int    `uri:"id" comment:"id"` // id
    TalentId int    `json:"talentId" comment:"人才id"`
    FileUri  string `json:"fileUri" comment:"附件路径"`
    common.ControlBy
}

func (s *HtResumeUpdateReq) Generate(model *models.HtResume) {
    if s.Id == 0 {
        model.Model = common.Model{Id: s.Id}
    }
    model.TalentId = s.TalentId
    model.FileUri = s.FileUri
    model.UpdateBy = s.UpdateBy // 添加这而，需要记录是被谁更新的
}

func (s *HtResumeUpdateReq) GetId() interface{} {
    return s.Id
}

// HtResumeGetReq 功能获取请求参数
type HtResumeGetReq struct {
    Id int `uri:"id"`
}

func (s *HtResumeGetReq) GetId() interface{} {
    return s.Id
}

// HtResumeDeleteReq 功能删除请求参数
type HtResumeDeleteReq struct {
    Ids []int `json:"ids"`
}

func (s *HtResumeDeleteReq) GetId() interface{} {
    return s.Ids
}
